import 'package:json_annotation/json_annotation.dart';
import 'package:dajia/src/model/Author.dart';

part 'Book.g.dart';

@JsonSerializable(fieldRename: FieldRename.snake, checked: true)
class Book {
  String name;
  Author author;
  String publishDate;
  String publisher;

  Book(this.name,this.author,this.publishDate,this.publisher);

  @override
  String toString() {
    return "Book{name: $name,author:$author,publishDate:$publishDate,publisher:$publisher}";
  }
  factory Book.fromJson(Map<String, dynamic> json) => _$BookFromJson(json);
}
